home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 1 / Gold Medal Software Volume 1 (Gold Medal) (1994).iso / graphics / tierra40.arj / TIERRA / EXTERN.H < prev    next >
C/C++ Source or Header  |  1992-09-09  |  10KB  |  191 lines

  1. /* extern.h   9-9-92  Artificial Life simulator */
  2. /* Tierra Simulator V4.0: Copyright (c) 1991, 1992 Tom Ray & Virtual Life */
  3.  
  4. /*
  5.  * sccsid: @(#)extern.h    1.38    12/8/91
  6.  */
  7.  
  8. #include "license.h"
  9.  
  10. #ifdef ALCOMM
  11. #include <mlayer.h>
  12. #endif /* ALCOMM */
  13.  
  14. #ifndef LEXTERN_H
  15. #define LEXTERN_H
  16.  
  17. extern FILE *oufr;
  18. extern HpInst soup;
  19. extern I32s BitBucket; /* place to dump return values */
  20. extern I32s alive;     /* run simulator alive * 1,000,000 instructions */
  21. extern I32s AverageSize;    /* average size of cells in soup */
  22. extern Pcells BottomDummy; /* dummy cell at bottom of reaper queue */
  23. extern Pcells BottomReap;/* index of cell bottom reaper queue, last to die */
  24. extern I32s BrkupCou;  /* count of output files break.n */
  25. extern I32s BrkupCum;  /* cumulative count of bytes output to break.n */
  26. extern I32s BrkupSiz;  /* size of output files break.n in K */
  27. extern I8s  Buff[120]; /* nice global text buff for all sorts of messages */
  28. extern I32s pos; /* file pointer for position in break.X files */
  29. extern I32s CelArSiz; /* size of each cells array */
  30. extern I32s CellsSize; /* number of allocated elements in cells array */
  31. extern I32s CountFlaw; /* counter for flaw random number */
  32. extern I32s CountMovMut;
  33. extern I32s CountMutRate;
  34. extern I32s CumGeneBnk;    /* Use cumulative gene files, or overwrite */
  35. extern I32s debug;     /* output info to screen for debugging */
  36. extern I32s debug_switch;
  37. extern I32s DiskOut;   /* 0 = no output to disk, 1 = output to disk */
  38. extern Event Disturb;    /* time of disturbance */
  39. extern float DistFreq; /* freq. of disturbance, in multiples of recovery t */
  40. extern Event DistNext;    /* time of next disturbance */
  41. extern float DistProp; /* proportion of cells killed in each disturbance */
  42. extern I32s DivSameSiz;/* 0 = off, 1 = daughter cell must be same size */
  43. extern I32s DivSameGen;/* 0 = off, 1 = daught cell must be same genotype */
  44. extern I32s DropDead;  /* millions instruction since last divide till dead */
  45. extern CellInd extr;      /* which cell to isolate */
  46. extern I8s ExtrG[20];   /* last geno extracted */
  47. extern I32s ExtractCount;
  48. extern I32s FirstOutDisk;
  49. extern I32s fe_lines;  /* approx hight in chars of screen, default 20 */
  50. extern I32s fe_width;  /* approx width in chars of screen, default 60 */
  51. extern I32s FreeBlocks;/* number of free blocks of memory */
  52. extern I32s GeneBnker; /* 0 = don't keep track genotyes, 1 = keep track */
  53. extern double Generations; /* elapsed generations (AvgPop/TimeBirth-Death) */
  54. extern I8s **GenInList;/* pointers to soup_in genome names */
  55. extern I8s *GenInBuf;  /* buffer containing soup_in genome names */
  56. extern float GenPerBkgMut;    /* generations per background mutation */
  57. extern float GenPerFlaw;    /* generations per flaw */
  58. extern float GenPerMovMut;    /* generations per move mutation */
  59. extern I32s GFormat; /* select genebank format -1 = first file = format */
  60. extern indx_t  GIndx;     /* global index structure */
  61. extern I8s  GoDown; /* flag to bring system down to defragment memory */
  62. extern I32s hangup; /* 0 = exit on error, 1 = hangup on error, for debugging */
  63. extern HistType *Hist;       /* pointer to struct for histograms */
  64. extern I32s HistSize; /* Num of elements alloced in Hist */
  65. extern float HistNStars; /* ratio of counts to stars */
  66. extern I32s HistPrint; /* boolean to tell us weather to print hists, to log */
  67. extern I8s IMapFile[80];  /* inst map filename, default.map is assumed */
  68. extern I8s IMode;      /* info display (plan,histo_size,histo_geno etc) */
  69. extern I32s InstD[INSTNUM+1];/* data struct for freq dist. of instructions */
  70. extern InstDef id[INSTNUM];
  71. extern Event InstExe;    /* counter of instructions executed */
  72. extern PInst is; /* struct for passing info between parse & execute */
  73. extern I32s isolate;   /* isolate the genome of the cell extr */
  74. extern Event LastDiv;    /* instructions executed at last divide */
  75. extern I32s Log;         /* boolean for FE loging */
  76. extern I32s MateSearchL;  /* used with HSEX, see soup_in.h */
  77. extern float MateProb;  /* used with HSEX, see soup_in.h */
  78. extern float MateXoverProp;  /* used with HSEX, see soup_in.h */
  79. extern I32s MateSizeEp;  /* used with HSEX, see soup_in.h */
  80. extern I32s Max_hits;  /* cardinality of most populous size class */
  81. extern I32s MaxFreeBlocks; /* number allocated elements in FreeMem array */
  82. extern float MaxMalMult;    /* multiple of cell size allowed for mal() */
  83. extern I32s MemModeFree;  /* unix chmod for when mem is dealloced,  */
  84. extern I32s MemModeProt;  /* chmod when mem is Alloced, NOT fully impl!*/
  85. extern I8s mes[10][80]; /* array of strings for message passing to frontend */
  86. extern I32s MalMode; /* 0= first fit, 1= better fit, 2= random preference,
  87.   3= near mother's address, 4= near dx address, 5= near top of stack address*/
  88. extern I32s MalReapTol; /* 1 = reap oldest creature within MalTol */
  89. extern I32s MalTol; /* multiple of avgsize to search for free block */
  90. extern I32s MalLimit;  /* search limit for memory allocation */
  91. extern I32s MinCellSize;    /* minimum cell size */
  92. extern I32s MinTemplSize;    /* minimum template size */
  93. extern float MovPropThrDiv; /* min proportion of daught cell filled by mov */
  94. extern I32s new_soup;  /* 0 = processed soup core, 1 = new soup core */
  95. extern I32s  Nop0;  /* instruct num corresponding to nop0 */
  96. extern I32s  Nop1;  /* instruct num corresponding to nop1 */
  97. extern I32s  NopS;  /* sum of nops */
  98. extern I32s NumCelAr; /* number of cells arrays */
  99. extern I32s NumCells;  /* present number of cells in soup */
  100. extern I32s NumGenDG; /* present # of permanent genotypes saved to disk */
  101. extern I32s NumGenDM; /* present # of temporary genotypes swapped out to disk */
  102. extern I32s NumGenRQ; /* present # of genotypes in RAM genequeue */
  103. extern I32s NumGenotypes; /* # of genotypes of adult cells extant in soup */
  104. extern I32s NumSizes; /* # of sizes of adult cells extant in soup */
  105. extern I32s PhotonSize;/* number of instructions in photon */
  106. extern I32s PhotonWidth; /* amount by which photons slide to determine fit */
  107. extern I32s RamBankSiz;/* number of genotypes stored in RAM */
  108. extern I32s RandIx1, RandIx2, RandIx3;    /* for tsrand() */
  109. extern I32s RateFlaw;  /* frequency of flaws */
  110. extern I32s RateMovMut;/* 1 / frequency of mutations per mov event */
  111. extern I32s RateMut;   /* number of instructions per mutations */
  112. extern I32s reaped;    /* 0 = reaper has not killed, 1 = reaper has killed */
  113. extern float ReapRndProp; /* rnd prop of top of reaper Q to reap from */
  114. extern I32s SaveFreq;  /* frequency of saving core_out, soup_out and list */
  115. extern I32s SigBlockSet; /* mask to block sig int in unix, for certain calls */
  116. extern I32s seed;      /* seed for random number generator */
  117. extern I32s SizDepSlice;  /* 0 = slice constant, 1 = slice size dependent */
  118. extern I32s siz_sl;    /* allocated size of *sl array */
  119. extern I32s SliceSize; /* number of instructions executed in each slice */
  120. extern I32s SliceStyle;/* select style of allocating slice size */
  121. extern I8s soup_fn[85];/* place for soup_in filename */
  122. extern I32s SoupBot;   /* index FreeMem struct for bottom of soup memory */
  123. extern I32s SoupTop;   /* index of FreeMem struct for top of soup memory */
  124. extern I8s Swap;   /* DOS flag whether to gq_swap or not */
  125. extern FILE *tfp_log; /* file pointer for log */
  126. extern I8s  TC_Menu;       /* flag unix sigint, to do a menu */
  127. extern Pcells ThisSlice; /* cell that is currently active */
  128. extern I32s TimeBirth; /* count of births in each million instruction */
  129. extern I32s TimeDeath; /* count of deaths in each million instruction */
  130. extern double TimePop; /* sum of ttime * NumCells for each million */
  131. extern Pcells TopDummy; /* dummy cell at top of reaper queue */
  132. extern Pcells TopReap;   /* cell at top reaper queue, next to die */
  133. extern I32s TotFlaw;   /* total number of flaws in this run */
  134. extern I32s TotMemUse; /* total memory use by soup, cells, and genebank */
  135. extern I32s TotMovMut; /* total number of move mutations in this run */
  136. extern I32s TotMut;    /* total number of background mutations in this run */
  137. extern I32s WatchExe;  /* mark executed instructions in genome in genebank */
  138. extern I32s WatchMov;  /* set mov bits in genome in genebank */
  139. extern I32s WatchTem;  /* set template bits in genome in genebank */
  140. extern I8s GenebankPath[80];    /* path for genebank */
  141. extern I8s OutPath[80];   /* path for disk output */
  142. extern I8s PhotonWord[80];    /* alphabetic representation of photon */
  143. extern Instruction PhotonInst[80];/* instructional representation of photon */
  144. extern I32s FreeMemCurrent;    /* current amount of free memory in soup */
  145. extern float SearchLimit; /* limit on search, as multiple of average size */
  146. extern I32s Search_limit; /* limit how far address instructions will search */
  147. extern float PutLimit; /* distance for intercellular communication */
  148. extern I32s Put_limit; /* limit on intercellular communications distance */
  149. extern I32s SoupSize;  /* size of soup memory, measured in instructions */
  150. extern Pcells Fp cells;  /* cells array */
  151. extern SList **sl; /* list of size classes for genebanker */
  152. extern Pmf FreeMem;    /* free memory array */
  153. extern double PhotonPow;    /* power for photon match slice size */
  154. extern double SlicePow;/* power for size dependent slice */
  155. extern double TrandArray[98];    /* for trand() */
  156. extern I32s  SavMinNum; /* minimum number of individuals to save genotype */
  157. extern float SavThrMem; /* thresh memory prop. to save genotype */
  158. extern float SavThrPop; /* thresh population prop. to save genotype */
  159. extern float SlicFixFrac;    /* fixed fraction of slice size */
  160. extern float SlicRanFrac;    /* random fraction of slice size */
  161. extern GList *gq_bot;    /* bottom of gene queue */
  162. extern GList *gq_top;    /* top of gene queue */
  163. extern LastOut lo;    /* last data output to disk */
  164. extern void (*slicer) ();
  165.  
  166. #ifdef ALCOMM
  167. extern I16s           AL_run_flag;
  168. extern I16s           VPORT;
  169. #endif /* ALCOMM */
  170.  
  171. extern I8u MSG_X ;
  172. extern I8u MSG_Y ;
  173. extern I8u ERR_X ;
  174. extern I8u ERR_Y ;
  175. extern I8u PLN_X ;
  176. extern I8u PLN_Y ;
  177. extern I8u HLP_X ;
  178. extern I8u HLP_Y ;
  179.  
  180. #ifdef MICRO
  181. extern I32s MC_step;
  182. extern Pcells MicroSlice; /* cell that is currently active */
  183. #endif
  184.  
  185.  
  186. #ifdef __TURBOC__
  187. extern I16s FE_DV_Mode;
  188. #endif
  189.  
  190. #endif /* LEXTERN_H */
  191.